﻿<?php
include("../public_files/conn.php");
include("../public_files/fenye.php");
	$page=$_POST['page'];
	$pagenum=$_POST['pagenum'];
	$type=$_POST['type'];		//官方or用户
	$sort_id=$_POST['sort_id'];		///获得分类ID



//////分页/////////////////////////////////////////////////////////////////////////////////////////////
				$page=isset($_POST['page'])?intval($_POST['page']):1;
				$num=10;																//每页显示条信息
				$total=mysql_num_rows(mysql_query("select * from  user_list_name where  status='0' and list_sort_id='$sort_id'")); 
				$pagenum=ceil($total/$num);					//总共有多少页
				
				If($page>$pagenum || $page == 0){
						echo "error : Can Not Found The page .";
						exit;
				}
				$offset=($page-1)*$num;				//从第几页开始从数据库取数据
				if($total<=$num){
				$num=$total;
				}
				
				$results=mysql_query("select * from user_list_name where status='0' and list_sort_id='$sort_id' order by create_time  limit $offset,$num  ");
				
///////////////////////////////////输出列表/////////////////////////////////////////
//$result=mysql_query("select * from user_list_name order by create_time") or die(mysql_error());

		while( $rows= mysql_fetch_array($results) ){
		if($rows['user_id']==0){
		$user_name="游客";
		}else{
		
		$result=mysql_query("select * from userinf where id='".$rows['user_id']."'")or die(mysql_error());
		$row=mysql_fetch_array($result);
		$user_name=$row['username'];
		}
		?>
		<div class="pl_1">
					<div class="pic">
						<img style="width:48px;height:48px;"src="<?php echo $rows['img_path']; ?>">
					</div>
					<div class="list_1_content">
						<div class="list_name">
							<?php echo "<a style='color:#444;font-size:21px;' href='MusicListContent.php?listname_id=$rows[id]&type=1&sort_id=$sort_id' onclick=add_browse_u($rows[id])>".$rows['list_name']."</a>";?><a href="#" style="color:#444;font-size:14px;">(单曲榜)</a><br/>
						</div>
						<div class="user_name">
							<span style="color:#777;font-size:12px;">发布时间 : </span><span style="color:#777;font-size:12px;"><?php echo $rows['create_time']; ?></span>
							<span class="un_useful_2">@:</span><a href="#" ><?php echo $user_name; ?></a>
						</div>
					</div>
				</div>
		
		
		

				<?php
				
				}

				
				echo '<div class="feiye">';
				$ajax_function="ajax_muc_home";
				fenyexianshi($page,$pagenum,$type,$ajax_function,$sort_id," -5","-5 ");////////////////逻辑分页、分块
				echo '</div>';
				



?>